package com.zzw.thread;

import java.util.concurrent.BlockingQueue;

public class Produce extends Thread {

	private BlockingQueue<String> bq;
	public Produce(BlockingQueue<String> bq){
		this.bq = bq;
	}
	
	public void run(){
		String[] strArr = new String[]{"JAVA","SPRING","SPRINGMVC"};
		for(int i = 0;i < 1000;i++){
			System.out.println(getName() + "");
			try {
				Thread.sleep(200);
				bq.put(strArr[i % 3]);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println(getName() + "" + bq);
		}
	}
}